import Home from './Home.vue';

frappe.provide('frappe.VueApp');

frappe.VueApp.vueapp = class {
    constructor({ wrapper }) {
        this.$parent = $(document);
        this.page = parent.page;		
		this.init();
		this.syncRunning = false;
    }
    init(){
        frappe.run_serially([
			//() => this.addMarkup(),
			() => this.make_body(),
		]);
    }
    make_body () {
        //this.$el = this.$parent.find('.main-section');        
        this.$el = this.$parent.find('#page-vue-page').find('.page-wrapper');       
        // this.vue = new Vue({            
        //     el: this.$el[0],
        //     data: {
        //     },
        //     render: h => h(Home),
        // });
        const app = Vue.createApp(Home);
        app.use(ElementPlus);
        app.mount(this.$el[0]);
    }
    setup_header () {
    }
    addMarkup() {
        const _markup = $(`<div id="vue-page-div">111</div>`);
        this.wrapper.append(_markup);
    }

};

export default frappe.VueApp.vueapp;